package com.luojing.myInterface.t2;

/**
 * java 中可以使类包含接口类型,这样该类可以接受所有实现该接口的类,并对齐进行相应的处理.例如java 中 Scanner 可以接受所有实现Readable接口的类,并对q
 * @author luojing
 * @create 2018/09/08 上午9:54
 **/
public class ChinaFisrtCarFactory implements CarFactory {
  private Gas gas;

  @Override
  public void pro() {
    System.out.println("create car");
  }

  public ChinaFisrtCarFactory(Gas gas) {
    this.gas = gas;
  }

  public void addGas(int i){
    gas.gas(i);
  }

  public static void main(String[] args) {
    ChinaFisrtCarFactory chinaFisrtCarFactory = new ChinaFisrtCarFactory(new FocusCar());
    chinaFisrtCarFactory.addGas(10);
  }
}
